<?php 
// Pega a action atual, para 
$action     = Zend_Controller_Front::getInstance()->getRequest()->getActionName(); 
$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName(); 
$module     = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();

// Prepara informações do menu lateral
$modMenu        = new Admin_Model_Menu();
$modInscricao   = new Remanejamento_Model_Inscricao();


$menuLateral    = $modMenu->listarMenusRemanejamento();
$infoUser       = $modInscricao->getSessaoInscricao('user'); ?>

<!DOCTYPE html>
<html lang="pt_BR">
    <head>
        <?php
        $titulo = "Secretaria de Educação - Módulo Admin";

        echo $this->headTitle($titulo) . "\n";
        echo $this->HeadMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
                              ->appendHttpEquiv('Description', $this->translate(""))
                              ->appendHttpEquiv('Keywords', $this->translate(""))
                              ->appendHttpEquiv('Content-Language', 'pt-BR')
                              ->appendHttpEquiv('GOOGLEBOT', 'index,follow')
                              ->appendHttpEquiv('revisit-after', '1 Day')
                              ->appendHttpEquiv('Author', 'Bruno da Costa Monteiro');
        
        // Busca os CSS e compacta em um arquivo para visualização
        echo $this->headLink()->offsetSetStylesheet(0, "/js/library/Bootstrap/css/bootstrap.min.css", 'all', null, array('id'=>'padraoCss'))
                              ->offsetSetStylesheet(1, "/js/library/Bootstrap/css/bootstrap-responsive.min.css", 'all')
                              ->offsetSetStylesheet(2, "/js/modules/remanejamento/layouts/css/jquery-ui-1.8.20.custom.css")
                              ->offsetSetStylesheet(3, "/js/modules/admin/layouts/css/admin.css");
        
        // Busca os js e compacta em um arquivo para visualização
        echo $this->headScript()->offsetSetFile(0, "/js/library/JQuery/jquery.2.0.0.min.js")
//                                ->offsetSetFile(2, "/js/library/JQuery/jquery-ui-1.8.20.custom.min.js")
                                ->offsetSetFile(1, "/js/library/Bootstrap/js/bootstrap.min.js");
        ?>
        
        <script type="text/javascript">
            var module      = "<?php echo $module ?>",
                controller  = "<?php echo $controller ?>",
                action      = "<?php echo $action ?>";        
        </script>
    </head>
    <body>

        <!-- Parte superior do projeto. -->
        <div class="header">
            <div class="container">
                <div class="row barra_superior">
                    <div class="span12">
                        Seja bem vindo(a): <?php echo $infoUser['nome'] ?>
                    </div>
                </div>
            </div>
        </div>

        <div class="container">
            <div class="row">
                <div class="span4">
                    <a href="" title="">
                        <img src="http://www.se.df.gov.br/wp-content/uploads/logo_sedf2.png" alt="SEDF - Secretaria de Estado de Educação">
                    </a>
                </div>
                
                <div class="span8 text-right padding-top-20">
                    <h4>Módulo de Gestao - Remanejamento</h4>
                </div>
            </div>
            
            <div class="separator"></div>
        </div>             
        
        
        <div class="container context margin-top-10">
            <div class="row-fluid">
                <!-- Menu lateral do projeto -->
                <div class="menuLateral span3 well well-small">
                    <div class="sidebar-nav hidden-tablet">
                        <?php foreach ($menuLateral as $menu): ?>
                            <ul class="nav nav-list">
                                <li class="nav-header"><?php echo $menu->getLabel() ?></li>
                                <?php if ($menu->hasChildren()): ?>
                                    <?php foreach ($menu->getPages() as $subMenu): ?>
                                        <li class="hide"><a href="<?php echo isset($subMenu->uri) ? $subMenu->uri : ( '/'. $subMenu->module .'/'. $subMenu->controller .'/'. $subMenu->action)?>" <?php echo isset($subMenu->uri) ? 'target="_blank"' : '' ?>><?php echo $subMenu->getLabel() ?></a></li>
                                    <?php endforeach ?>
                                <?php endif ?>
                            </ul>
                        <?php endforeach ?>
                    </div>
                </div>                
                
                <!-- Parte principaldo projeto. -->
                <div class="span9 well well-small">
                    <?php //echo $this->navigation($menuLateral)->breadcrumbs()->render() ?>
                    <?php echo $this->layout()->content; ?>                    
                </div>
            </div>
        </div>
        

        <div id="modalSystem" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">Informações do sistema</h3>
            </div>
            <div class="modal-body">
                <!-- Informações via Javascript -->
            </div>
            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">Fechar</button>
            </div>
        </div>
        
        
        <script type="text/javascript" src="/js/modules/admin/admin.js"></script>
    </body>
</html>